package ch6;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class WhileTest {
    public static void main(String[] args) {
        //输入一个大于6的偶数
        Scanner in = new Scanner(System.in);
        int num = 0;
        while (true) {
            System.out.println("input a num:");
            num = in.nextInt();
            if (num > 6 && num % 2 == 0) {
                break;
            }//不需要else
            System.out.println("输入错误");
        }
        System.out.println("您输入的正确，是：" + num);
    }
}
